|
|
|
|
|
|
|
Including the Resource File |
|
|
|
|
|
|
|
|
Now that you have a finished resource file, include it in an application and see how to access the resources defined in it. |
|
|
|
|
|
|
|
|
You first need to create a new project with command buttons that will display each string defined in the resource file either in a label control or in a message box. There will also be a picture control on the form to display the bitmap. Finally, the icon will be loaded so that it's displayed as part of the command button that loaded it. |
|
|
|
|
|
|
|
|
Add the six command buttons, PictureBox, and Label controls to the form as shown in Figure 19.7. Then change the properties of these controls as shown in Table 19.4. |
|
|
|
|
|
|
|
|
Figure 19.7.
Creating the Resource demo form in Visual Basic. |
|
|
|
|
| TABLE 19.4. SETTING THE DEMO FORM'S PROPERTIES. | | Control | Name | Caption | Style | | Command1 | cmdMsgbox1 | Display Msgbox #1 | N/A | | Command2 | cmdMsgbox2 | Display Msgbox #2 | N/A | | Command3 | cmdLabel1 | Display Label #1 | N/A | | Command4 | cmdLabel2 | Display Label #2 | N/A | | Command5 | cmdBitmap | Load Bitmap | N/A |
|
|
|
|
|
|
(table continued on next page) |
|
|
|
|
|